3.26 \(\int \cosh ^2(\frac {1}{4}+x+x^2) \, dx\)

Optimal. Leaf size=56 \[ \frac {1}{8} \sqrt {\frac {\pi }{2}} \text {erf}\left (\frac {2 x+1}{\sqrt {2}}\right )+\frac {1}{8} \sqrt {\frac {\pi }{2}} \text {erfi}\left (\frac {2 x+1}{\sqrt {2}}\right )+\frac {x}{2} \]

[Out]

1/2*x+1/16*erf(1/2*(1+2*x)*2^(1/2))*2^(1/2)*Pi^(1/2)+1/16*erfi(1/2*(1+2*x)*2^(1/2))*2^(1/2)*Pi^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.454, Rules used = {5377, 5375, 2234, 2204, 2205} \[ \frac {1}{8} \sqrt {\frac {\pi }{2}} \text {Erf}\left (\frac {2 x+1}{\sqrt {2}}\right )+\frac {1}{8} \sqrt {\frac {\pi }{2}} \text {Erfi}\left (\frac {2 x+1}{\sqrt {2}}\right )+\frac {x}{2} \]

Antiderivative was successfully verified.

[In]

Int[Cosh[1/4 + x + x^2]^2,x]

[Out]

x/2 + (Sqrt[Pi/2]*Erf[(1 + 2*x)/Sqrt[2]])/8 + (Sqrt[Pi/2]*Erfi[(1 + 2*x)/Sqrt[2]])/8

Rule 2204

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[(F^a*Sqrt[Pi]*Erfi[(c + d*x)*Rt[b*Log[F], 2
]])/(2*d*Rt[b*Log[F], 2]), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2205

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[(F^a*Sqrt[Pi]*Erf[(c + d*x)*Rt[-(b*Log[F]),
 2]])/(2*d*Rt[-(b*Log[F]), 2]), x] /; FreeQ[{F, a, b, c, d}, x] && NegQ[b]

Rule 2234

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[F^(a - b^2/(4*c)), Int[F^((b + 2*c*x)^2/(4*c))
, x], x] /; FreeQ[{F, a, b, c}, x]

Rule 5375

Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[1/2, Int[E^(a + b*x + c*x^2), x], x] + Dist[1/2
, Int[E^(-a - b*x - c*x^2), x], x] /; FreeQ[{a, b, c}, x]

Rule 5377

Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]^(n_), x_Symbol] :> Int[ExpandTrigReduce[Cosh[a + b*x + c*x^2]^n, x
], x] /; FreeQ[{a, b, c}, x] && IGtQ[n, 1]

Rubi steps

\begin {align*} \int \cosh ^2\left (\frac {1}{4}+x+x^2\right ) \, dx &=\int \left (\frac {1}{2}+\frac {1}{2} \cosh \left (\frac {1}{2}+2 x+2 x^2\right )\right ) \, dx\\ &=\frac {x}{2}+\frac {1}{2} \int \cosh \left (\frac {1}{2}+2 x+2 x^2\right ) \, dx\\ &=\frac {x}{2}+\frac {1}{4} \int e^{-\frac {1}{2}-2 x-2 x^2} \, dx+\frac {1}{4} \int e^{\frac {1}{2}+2 x+2 x^2} \, dx\\ &=\frac {x}{2}+\frac {1}{4} \int e^{-\frac {1}{8} (-2-4 x)^2} \, dx+\frac {1}{4} \int e^{\frac {1}{8} (2+4 x)^2} \, dx\\ &=\frac {x}{2}+\frac {1}{8} \sqrt {\frac {\pi }{2}} \text {erf}\left (\frac {1+2 x}{\sqrt {2}}\right )+\frac {1}{8} \sqrt {\frac {\pi }{2}} \text {erfi}\left (\frac {1+2 x}{\sqrt {2}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.08, size = 48, normalized size = 0.86 \[ \frac {1}{16} \left (\sqrt {2 \pi } \text {erf}\left (\frac {2 x+1}{\sqrt {2}}\right )+\sqrt {2 \pi } \text {erfi}\left (\frac {2 x+1}{\sqrt {2}}\right )+8 x\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Cosh[1/4 + x + x^2]^2,x]

[Out]

(8*x + Sqrt[2*Pi]*Erf[(1 + 2*x)/Sqrt[2]] + Sqrt[2*Pi]*Erfi[(1 + 2*x)/Sqrt[2]])/16

________________________________________________________________________________________

fricas [A]  time = 0.41, size = 40, normalized size = 0.71 \[ \frac {1}{16} \, \sqrt {\pi } {\left (\sqrt {2} \operatorname {erf}\left (\frac {1}{2} \, \sqrt {2} {\left (2 \, x + 1\right )}\right ) + \sqrt {2} \operatorname {erfi}\left (\frac {1}{2} \, \sqrt {2} {\left (2 \, x + 1\right )}\right )\right )} + \frac {1}{2} \, x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(1/4+x+x^2)^2,x, algorithm="fricas")

[Out]

1/16*sqrt(pi)*(sqrt(2)*erf(1/2*sqrt(2)*(2*x + 1)) + sqrt(2)*erfi(1/2*sqrt(2)*(2*x + 1))) + 1/2*x

________________________________________________________________________________________

giac [C]  time = 0.13, size = 42, normalized size = 0.75 \[ \frac {1}{16} \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (\frac {1}{2} \, \sqrt {2} {\left (2 \, x + 1\right )}\right ) + \frac {1}{16} i \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (-\frac {1}{2} i \, \sqrt {2} {\left (2 \, x + 1\right )}\right ) + \frac {1}{2} \, x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(1/4+x+x^2)^2,x, algorithm="giac")

[Out]

1/16*sqrt(2)*sqrt(pi)*erf(1/2*sqrt(2)*(2*x + 1)) + 1/16*I*sqrt(2)*sqrt(pi)*erf(-1/2*I*sqrt(2)*(2*x + 1)) + 1/2
*x

________________________________________________________________________________________

maple [C]  time = 0.23, size = 49, normalized size = 0.88 \[ \frac {x}{2}+\frac {\sqrt {\pi }\, \sqrt {2}\, \erf \left (\sqrt {2}\, x +\frac {\sqrt {2}}{2}\right )}{16}-\frac {i \sqrt {\pi }\, \sqrt {2}\, \erf \left (i \sqrt {2}\, x +\frac {i \sqrt {2}}{2}\right )}{16} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cosh(1/4+x+x^2)^2,x)

[Out]

1/2*x+1/16*Pi^(1/2)*2^(1/2)*erf(2^(1/2)*x+1/2*2^(1/2))-1/16*I*Pi^(1/2)*2^(1/2)*erf(I*2^(1/2)*x+1/2*I*2^(1/2))

________________________________________________________________________________________

maxima [C]  time = 0.42, size = 45, normalized size = 0.80 \[ \frac {1}{16} \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (\sqrt {2} x + \frac {1}{2} \, \sqrt {2}\right ) - \frac {1}{16} i \, \sqrt {2} \sqrt {\pi } \operatorname {erf}\left (i \, \sqrt {2} x + \frac {1}{2} i \, \sqrt {2}\right ) + \frac {1}{2} \, x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(1/4+x+x^2)^2,x, algorithm="maxima")

[Out]

1/16*sqrt(2)*sqrt(pi)*erf(sqrt(2)*x + 1/2*sqrt(2)) - 1/16*I*sqrt(2)*sqrt(pi)*erf(I*sqrt(2)*x + 1/2*I*sqrt(2))
+ 1/2*x

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.02 \[ \int {\mathrm {cosh}\left (x^2+x+\frac {1}{4}\right )}^2 \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cosh(x + x^2 + 1/4)^2,x)

[Out]

int(cosh(x + x^2 + 1/4)^2, x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \cosh ^{2}{\left (x^{2} + x + \frac {1}{4} \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(1/4+x+x**2)**2,x)

[Out]

Integral(cosh(x**2 + x + 1/4)**2, x)

________________________________________________________________________________________